package com.example.ceshi.service;

import com.example.ceshi.entity.UserSpread;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.ArrayList;
import java.util.List;

/**
* @author Administrator
* @description 针对表【user_spread(用户推广关系表)】的数据库操作Service
* @createDate 2023-01-13 10:20:09
*/
public interface UserSpreadService extends IService<UserSpread> {
    public  static List<UserSpread> trees(List<UserSpread> treeList){
        //创建初始数据
        List<UserSpread> trees = new ArrayList<>();
        //bianli caidan jihe
        for (UserSpread userSpread :treeList){
            if(userSpread.getSpreadUid() == 0){
                trees.add(findchildren(userSpread,treeList));
            }
        }
        return trees;
    }

    static UserSpread findchildren(UserSpread userSpread, List<UserSpread> treeList) {

        return userSpread;
    }
}
